import Vue from 'vue'
import Router from 'vue-router'
import Home from '../components/Home'
import HelloWorld from '../components/HelloWorld'
import Register from '../components/Register'
Vue.use(Router)

//注入插件
Vue.use(Router)
 
//定义路由
const routes =  [
   //添加映射关系
   {
    //默认首页
      path: '/',
      redirect: '/Home'
    },
    {
      path: '/Home',
      component: Home
    },
    
    {
      path: '/Register',
      component: Register
    },{
      path: '/HelloWorld',
      component: HelloWorld
    }

]
 
//创建router实例
const router = new Router({
  routes
})
 
//导出router实例
export default router
